Allow overriding name via entity registry#12292
Conversation
| 'chardet==3.0.4', | ||
| 'astral==1.5', | ||
| 'certifi>=2017.4.17', | ||
| 'attrs==17.4.0', |
There was a problem hiding this comment.
This introduces attrs to the codebase as per home-assistant/architecture#4
| domain = attr.ib(type=str, default=None, init=False, repr=False) | ||
|
|
||
| def __attrs_post_init__(self): | ||
| """Computed properties.""" |
There was a problem hiding this comment.
Do these behave as properties or instance attributes, ie write protected or not?
There was a problem hiding this comment.
They are write protected because the class is annotated with frozen=True. The class is frozen after the post_init has run. It allows me to operate on the values entered before it's frozen.
you have to read the 2 methods from attr as attrib and attrs btw. Makes it easier to remember
|
Will this also fix something like #12287 ? |
* Allow overriding name via entity registry * Update requirements
|
Included this in 0.63.1 because another PR had a test that used something from this PR and can't be bothered to split it up. |
|
Do I understand this correctly: The final friendly name of an entity is now determined by these things with decreasing priority:
? |
|
Correct, as it always should have been. |
Description:
This allows overriding the name of an entity via the entity registry.
If a name is defined in the entity registry, it is always used in favor of the name supplied by the device.
Define name by adding a name value under an entry in
entity_registry.yaml.Checklist:
If user exposed functionality or configuration variables are added/changed:
If the code does not interact with devices:
toxrun successfully. Your PR cannot be merged unless tests pass